import React, { Component } from 'react';

export default class Input extends Component{
    constructor(data){
        super(data)
        this.state={
            InputValue:''
        }
    }
    onChange(e){
        this.setState({
            InputValue:e.target.value
        },()=>{
            
        })
    }
    ClearInput(){
        this.setState(
        {InputValue:''}
        )
    }
    render(){
        console.log('Input被打印了');
        return (
            <div className="todolist-body">
                <input value={this.state.InputValue} onKeyUp={this.props.onEnter.bind(this)} onChange={this.onChange.bind(this)} placeholder='请输入要做的事情' type="text"/>
            </div>
        )
    }
}